package com.erp.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName(value = "sys_role")
public class Role {

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String Name;
    private String remark;
    private Integer available;
    private Date createtime;

    /*一个角色  可能有多个权限*/
    @TableField(exist = false)
    private Integer pid;
    private List<Permission> permissions;

    /*一个角色下，有多少用户*/
    private Integer uid;
    private List<UserInfo> users;
}
